package com.yzcrm.common.systemEnum;

public enum RealmEnum {
    /**
     * realm Enum
     */
    CRM("crm",1,"客户关系","NULL"),
    BI("bi",2,"报表","NULL"),
    MANAGE("manage",3,"管理","NULL"),
    WORK("work", 4,"工作","NULL"),
    OA("oa",5,"办公","NULL"),
    PROJECT("project",6,"项目","YZHT"),
    PSI("psi",7,"进销存","YZHK"),
    FINANCE("finance",8,"财务","NULL"),
    RELAM_NULL("NULL",0,"NULL","NULL"),
    QUOTATION_COMB("quotationComb",730,"报价模板","NULL"),
    QUOTATION("quotation",750,"报价列表",""),
    KMS("kms",9,"知识库","NULL"),
    ;

    private final String name;
    private final int  type;
    private final String remarks;
    private final String num;
    RealmEnum(String name, int type, String remarks, String num) {
        this.name = name;
        this.type = type;
        this.remarks = remarks;
        this.num = num;
    }
    public static RealmEnum parse(int type) {
        for (RealmEnum Enum : RealmEnum.values()) {
            if (Enum.getType()==type) {
                return Enum;
            }
        }
        return RELAM_NULL;
    }

    public static RealmEnum parse(String name) {
        for (RealmEnum Enum : RealmEnum.values()) {
            if (Enum.getName().equals(name)) {
                return Enum;
            }
        }
        return RELAM_NULL;
    }

    public String getName() {
        return name;
    }

    public int getType() {
        return type;
    }

    public String getRemarks() {
        return remarks;
    }

    public String getNum() {
        return num;
    }

}
